import { lazy } from 'react'
const Login = lazy(() => import('../pages/Login'))
const Index = lazy(() => import('../pages/index'))

// 首页
const Home = lazy(() => import('../pages/home'))


// 访客
const List = lazy(()=>import('../pages/visitors/List'))
const Add = lazy(()=>import('../pages/visitors/add'))
const Det = lazy(()=>import('../pages/visitors/detailed'))
const ViDetail = lazy(()=>import('../pages/visitors/detail'))


// 部门管理
const DepartmentList = lazy(()=>import('../pages/Department/DepartmentList'))
const DepartmentAddUp = lazy(()=>import('../pages/Department/DepartmentAddUp'))


//管理员
const Addadd = lazy(()=>import('../pages/Administration/Adadd'))
const Adlist = lazy(()=>import('../pages/Administration/Adlist'))

//系统设置
const System = lazy(()=>import('../pages/system/System'))


// 校园动态
const SchoolList = lazy(()=>import('../pages/School/SchoolList'))
const SchoolAddUp = lazy(()=>import('../pages/School/SchoolAddUp'))


// 审核日志
const Audit = lazy(()=>import('../pages/audit/list'))
const Detail = lazy(()=>import('../pages/audit/deta'))


// 核销人员管理
const WrieoffList = lazy(() => import('../pages/writeoff/WrieoffList'))
const WrieoffAdd = lazy(() => import('../pages/writeoff/WrieoffAdd'))
const WrieoffJournal = lazy(() => import('../pages/writeoff/WrieoffJournal'))
// 引入路由守卫封装
// import 


// 定义接口规范
interface Iroute{
    title:any;
    path:string
    element:JSX.Element
    children ?:Array<Iroute>
}
const route:Array<Iroute>=[
    {path:'/',element:<Index></Index>,title:{title:'访客登录'}},
    {path:'/login',element:<Login></Login>,title:{title:'访客登录'}},
    {path:'/index',element:<Index></Index>,title:{title:'访客系统'},children:[
        {path:'/index',element:<Home></Home>,title:{title:'访客系统'}},
    ]},
    {path:'/table',element:<Index></Index>,title:{title:'访客记录'},children:[
        {path:'/table/list',element:<List></List>,title:{title:'访客列表'}},
        {path:'/table/add',element:<Add></Add>,title:{title:'访客添加'}},
        {path:'/table/detail/:id',element:<ViDetail></ViDetail>,title:{title:'访客列表详情'}},
        {path:'/table/detailed',element:<Det></Det>,title:{title:'负责人操作导入详细'}},
    ]},
    {path:'/department',element:<Index></Index>,title:{title:'部门管理'},children:[
        {path:'/department/list',element:<DepartmentList />,title:{title:'部门列表'}},
        {path:'/department/add_upd',element:<DepartmentAddUp />,title:{title:'部门添加修改'}},
    ]},

    {path:'/Admin',element:<Index></Index>,title:{title:'管理员'},children:[
        {path:'/Admin/Adlist',title:{title:'管理员列表'},element:<Adlist />},
        {path:'/Admin/Adadd',title:{title:'管理员添加修改'},element:<Addadd />},
    ]},
    {path:'/sty',element:<Index></Index>,title:{title:'系统设置'},children:[
        {path:'/sty/System',title:{title:'系统设置'},element:<System />},
    ]},
    

    {path:'/audit',element:<Index></Index>,title:{title:'审核日志'},children:[
        {path:'/audit/list',element:<Audit />,title:{title:'审核列表'}},
        {path:'/audit/deta',element:<Detail />,title:{title:'审核详情'}},
    ]},
    {path:'/school',title:{title:""},element:<Index></Index>,children:[
        {path:'/school/list',title:{title:"校园动态列表"},element:<SchoolList />},
        {path:'/school/add_upd',title:{title:"校园动态添加修改"},element:<SchoolAddUp />},
    ]},
        // 核销
        {
            path: '/writeoff', element: <Index></Index>,title:{title:'核销列表'}, children: [
                { path: '/writeoff/wrieofflist',title:{title:'核销列表'}, element: <WrieoffList></WrieoffList> },
                { path: '/writeoff/wrieoffadd',title:{title:'核销添加修改'}, element: <WrieoffAdd></WrieoffAdd> },
                { path: '/writeoff/wrieoffjournal',title:{title:'核销人员日志'}, element: <WrieoffJournal></WrieoffJournal> },
            ]
        }
]
export default route